//
//  DemoTableControllerViewController.m
//  FPPopoverDemo
//
//  Created by Alvise Susmel on 4/13/12.
//  Copyright (c) 2012 Fifty Pixels Ltd. All rights reserved.
//

#import "DemoTableController.h"
#import "BaseHiddenTabBarController.h"
@interface DemoTableController ()

@end

@implementation DemoTableController

@synthesize delegate;

- (void)viewDidLoad
{
    [super viewDidLoad];
//    self.title = @"菜单";
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source
//
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//    //这个方法用来告诉表格有几个分组
//    return 2;
//}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 8;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    
    if(cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
    }
	if (indexPath.row == 0)
	{
		cell.textLabel.text = @"爱讲冷笑话";
	}
	else if (indexPath.row == 1)
	{
		cell.textLabel.text = @"编辑推荐";
	}
	else if (indexPath.row == 2)
	{
		cell.textLabel.text = @"审帖";
	}
	else if (indexPath.row == 3)
	{
		cell.textLabel.text = @"发表冷笑话";
	}
	else if (indexPath.row == 4)
	{
		cell.textLabel.text = @"意见反馈";
	}
    else if (indexPath.row == 5)
	{
		cell.textLabel.text = @"检测新版本";
	}
    else if (indexPath.row == 6)
	{
		cell.textLabel.text = @"关于";
	}
    else if (indexPath.row == 7)
	{
		cell.textLabel.text = @"退出登录";
	}
    return cell;
}

#pragma mark - Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
//        [fppController dismissPopoverAnimated:YES];
        if (self.delegate && [self.delegate respondsToSelector:@selector(changeOtherView)]) {
            [self.delegate changeOtherView];
        }
    }
}

@end
